<?php (!defined('IN_SYSTEM') || !defined('ADMIN_PRE')) && exit('Access Denied!');?>
{admintemplate header}
<div class="box">
	<div class="heading">
	<h1>评论管理</h1>
	<div class="buttons">
	<a href="{url admin.php?m=comment&mod=desc}" {if $mod == 'desc'}class="on"{/if}>摘要模式</a>
	<a href="{url admin.php?m=comment&mod=list}" {if $mod == 'list'}class="on"{/if}>列表模式</a>
	</div>
	</div>
	<div class="main">
		<div class="search">
			<form name="search" method="get" action="{url admin.php}" autocomplete="off">
			<input type="hidden" name="m" value="comment" />
			<input type="hidden" name="f" value="index" />
			<input type="hidden" name="mod" value="{$mod}" />
				<fieldset>
					<legend>评论查找</legend>
						关键字：
						<input type="text" name="keyword" size="15" value="{urldecode($keyword)}" />
						<input type="submit" name="s" class="button" value="开始查找" />
						<input type="button" class="button" value="所有评论" onclick="window.location.href='{url admin.php?m=comment&mod=$mod}'" />
						<input type="button" class="button" value="未审核({$no_check_num})" onclick="window.location.href='{url admin.php?m=comment&mod=$mod&check=no}'" />
						<input type="button" class="button" value="已审核" onclick="window.location.href='{url admin.php?m=comment&mod=$mod&check=yes}'" />
				</fieldset>
			</form>
		</div>
	
		<form name="update" method="post" action="{url admin.php?m=comment}" autocomplete="off">
		<input type="hidden" name="f" id="f" value="" />
			<table class="list" id="list" cellspacing="0">
			<thead>
				<tr>
					<td width="1" class="center">
					<input type="checkbox" class="checkbox" value="1" name="chkall" onclick="check_all(this)" />
					</td>
					<td class="left">评论</td>
					<td width="150" class="center">日期</td>
					<td width="150" class="center">操作</td>
				</tr>
			</thead>
			<tbody>
				{loop $result $row}
				<tr id="row_{$row['cid']}" {if $row['ischeck']}class="highlight"{/if}>
					<td align="center" valign="top"><input type="checkbox" name="id[]" value="{$row['cid']}" class="checkbox" /></td>
					<td valign="top" class="left">
						<strong><a href="{if $row['homepage']}{$row['homepage']}{else}#{/if}">{$row['username']}</a></strong> | <a href="mailto:{$row['email']}" title="发送邮件">{$row['email']}</a> | {$row['ip']} {if $row['ishide']}| <span style="color:red">隐藏评论</span>{/if}
						<br />
						{if $mod == 'desc'}
						<p id="c_{$row['cid']}" style="font-size:13px">{$row['content']}</p>
						<p id="e_{$row['cid']}" style="display:none"></p>
						{/if}
						<p style="color:#666">所在日志：<a href="{url('index.php?aid='.$row['aid'],'article')}" target="_blank">{$row['title']}</a> 发表于：{gdate('Y-m-d H:i', $row['arttime'])}</p>
					</td>
					<td align="center" valign="top">{gdate('Y-m-d H:i', $row['dateline'])}</td>
					<td align="center" valign="top">
					<a href="javascript:;" onclick="edit_comment({$row['cid']})">编辑</a> | 
					{if $row['ischeck']}
					<a href="javascript:;" onclick="check_comment({$row['cid']},false)" id="check_a_{$row['cid']}">不审核</a>{else}
					<a href="javascript:;" onclick="check_comment({$row['cid']},true)" id="check_a_{$row['cid']}">审核</a>{/if}
					 | <a href="javascript:;" onclick="delete_comment({$row['cid']})" title="删除这条评论">删除</a></td>
				</tr>
				{/loop}
				<tr>
					<td><input type="checkbox" class="checkbox" value="1" name="chkall" onclick="check_all(this)" /></td>
					<td colspan="5"  class="left">{pager($num,$pagesize,$page,$url)}全选 
					<input type="button" class="button" onclick="do_submit('check',this.form)" value="审核"/>
					<input type="button" class="button" onclick="do_submit('nocheck',this.form)" value="取消审核"/>
					<input type="button" class="button" onclick="do_submit('delete',this.form)" value="删除"/>
					</td>
				</tr>
			</tbody>	
			</table>
		</form>
	</div>
</div>
{admintemplate footer}